home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / hce.lha / HCE / LibSource / clib / Stdio / src / isatty.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-02  |  340 b   |  22 lines

  1. #include <stdio.h>
  2. #include <fcntl.h>
  3. #include <errno.h>
  4.  
  5. extern struct _device *_devtab[];
  6.  
  7. int
  8. isatty(fd)
  9. unsigned int fd;
  10. {
  11.     extern long IsInteractive();
  12.     register struct _device *fp;
  13.  
  14.     fp = &((*_devtab)[fd]);
  15.     if ( fd >=OPEN_MAX || !fp->fileHandle ) {
  16.         errno = EBADF;
  17.         return -1;
  18.     }
  19.  
  20.     return ( IsInteractive(fp->fileHandle) != 0 );
  21. }
  22.